package com.nanyang.tms.domain.waybill.shipment.context;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import cn.hutool.core.util.NumberUtil;
import lombok.Data;
@Data
/****************
 * 通用context
 * @author Administrator
 *
 */
public class CalculateSupplierWeightContext implements Serializable{
	//输入
	private static final long serialVersionUID = 1L;
	private String countyCode;  //国家编号 //从request输入
	private String cityCode;//城市编码  //从request输入
	private BigDecimal weight;  //客户重量  //从request输入
	private String productCode; //产品编码  //从request输入
	private String cargoTypeCode; //货物类型字典值   //从request输入
	private String cargoTypeName; //货物类型字典值名称  //从request输入
    private List<CalculateSupplierWeightVolumeContext> calculateSupplierWeightVolumeContext;  //从request输入
    
    
    //输出
    private BigDecimal totalChargeWeight; //收货总计费重
    private BigDecimal totalWeight; //收货总实际重 gw
    private BigDecimal totalVolumeWeight; //收货总材积重 vw
    private BigDecimal totalPrieceChargeWeight; //收货总件计费重
    private BigDecimal receiptVolume; //收货立方
    private BigDecimal carryRule ; //进位规则值
    private String     carryTypeCode;
    private BigDecimal quotient; //商
    private BigDecimal remainder; //余数
    public CalculateSupplierWeightContext(){
    	this.calculateSupplierWeightVolumeContext=new ArrayList<CalculateSupplierWeightVolumeContext>();
    }
    public void setCarryRule(BigDecimal carryRule){
    	this.carryRule=carryRule;
    	BigDecimal[] result=totalChargeWeight.divideAndRemainder(carryRule);
    	this.quotient=result[0];
    	this.remainder=result[1];
    }
}
